import request from '@/router/axios';


//特殊特性清单
//特殊特性清单列表
export const getFeatureList = (params) => {
  return request({
    url: '/api/hg-public/prdsclist/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增特殊特性清单
export const addFeature = (row) => {
  return request({
    url: '/api/hg-public/prdsclist/save',
    method: 'post',
    data: row
  })
}

//删除特殊特性清单
export const removeFeature = (ids) => {
  return request({
    url: '/api/hg-public/prdsclist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
//根据产品ID获取特性下拉选
export const getProdFeatures = (productId) => {
  return request({
    url: '/api/hg-public/prdsclist/listByProductId',
    method: 'get',
    params: {
      productId,
    }
  })
}

//根据工序ID获取检具下拉选
export const getFeatures = (procedureId) => {
  return request({
    url: '/api/hg-public/controlplan/getCheckTool',
    method: 'get',
    params: {
      procedureId,
    }
  })
}
//获取特殊特性清单详情
export const getFeature = (id) => {
  return request({
    url: '/api/hg-public/prdsclist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
//更新特殊特性清单
export const updateFeature = (row) => {
  return request({
    url: '/api/hg-public/prdsclist/submit',
    method: 'post',
    data: row
  })
}

//D/LTD特性清单
//D/LTD特性清单列表
export const getDLTDList = (params) => {
  return request({
    url: '/api/hg-public/dtldfeaturelist/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增D/LTD特性清单
export const addDLTD = (row) => {
  return request({
    url: '/api/hg-public/dtldfeaturelist/save',
    method: 'post',
    data: row
  })
}

//删除D/LTD特性清单
export const removeDLTD = (ids) => {
  return request({
    url: '/api/hg-public/dtldfeaturelist/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
//获取D/LTD特性清单详情
export const getDLTD = (id) => {
  return request({
    url: '/api/hg-public/dtldfeaturelist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
//更新D/LTD特性清单
export const updateDLTD = (row) => {
  return request({
    url: '/api/hg-public/dtldfeaturelist/update',
    method: 'post',
    data: row
  })
}


//产品要求
//产品要求列表
export const getDemandList = (params) => {
  return request({
    url: '/api/hg-public/prdreqm/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增产品要求
export const addDemand = (row) => {
  return request({
    url: '/api/hg-public/prdreqm/save',
    method: 'post',
    data: row
  })
}

//删除产品要求
export const removeDemand = (ids) => {
  return request({
    url: '/api/hg-public/prdreqm/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
//获取产品要求详情
export const getDemand = (id) => {
  return request({
    url: '/api/hg-public/prdreqm/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
//更新产品要求
export const updateDemand = (row) => {
  return request({
    url: '/api/hg-public/prdreqm/update',
    method: 'post',
    data: row
  })
}

//产品过程流程图
//产品过程流程图列表
export const getFlowList = (params) => {
  return request({
    url: '/api/hg-public/prdprocedureflowchart/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增产品过程流程图
export const addFlow = (row) => {
  return request({
    url: '/api/hg-public/prdprocedureflowchart/saveBatch',
    method: 'post',
    data: row
  })
}
//批量编辑产品过程流程图
export const uploadBatchFlow = (row) => {
  return request({
    url: '/api/hg-public/prdprocedureflowchart/updateBatch',
    method: 'post',
    data: row
  })
}
//删除产品过程流程图
export const removeFlow = (ids) => {
  return request({
    url: '/api/hg-public/prdprocedureflowchart/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新产品过程流程图
export const updateFlow = (row) => {
  return request({
    url: '/api/hg-public/prdprocedureflowchart/update',
    method: 'post',
    data: row
  })
}

//获取产品过程流程图详情
export const getFlow = (id) => {
  return request({
    url: '/api/hg-public/prdprocedureflowchart/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
//根据产品类型获取下拉选
export const getTypeProducts = (params) => {
  return request({
    url: '/api/hg-public/prdinfo/list',
    method: 'get',
    params: {
      ...params
    }
  })
}

//产品工序
//产品工序列表
export const getProProcessList = (params) => {
  return request({
    url: '/api/hg-public/prdprocedure/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
// 产品外协工序
export const getProOutProcessList = (params) => {
  return request({
    url: '/api/hg-public/prdprocedure/getOutReachProcedure',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增产品工序
export const addProProcess = (row) => {
  return request({
    url: '/api/hg-public/prdprocedure/save',
    method: 'post',
    data: row
  })
}

//删除产品工序
export const removeProProcess = (ids) => {
  return request({
    url: '/api/hg-public/prdprocedure/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新产品工序
export const updateProProcess = (row) => {
  return request({
    url: '/api/hg-public/prdprocedure/update',
    method: 'post',
    data: row
  })
}

//获取当前产品维护的工序
export const getProdProcess = (productId) => {
  return request({
    url: '/api/hg-public/prdprocedure/procedureList',
    method: 'get',
    params: {
      productId,
    }
  })
}
//获取当前产品维护的工序-产品BOM用
export const getPrdProcess = (productId) => {
  return request({
    url: '/api/hg-public/prdprocedure/list',
    method: 'get',
    params: {
      productId,
    }
  })
}

//获取产品工序详情
export const getProProcess = (id) => {
  return request({
    url: '/api/hg-public/prdprocedure/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
// 获取产品的设备清单
export const getProdequipmentList = (params) => {
  return request({
    url: '/api/hg-public/produceequipmentlist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}
// 获取设备清单
export const getEquipmentList = (params) => {
  return request({
    url: '/api/hg-public/prdprocedure/getEquipment',
    method: 'get',
    params: {
      ...params,
    }
  })
}
// 获取产品的生产设备+检测设备清单
export const getequipmentList = (params) => {
  return request({
    url: '/api/hg-public/prdprocedure/getEquipment',
    method: 'get',
    params: {
      ...params,
    }
  })
}
// 获取产品的模具清单
export const getProdMouldList = (params) => {
  return request({
    url: '/api/hg-public/mouldlist/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// 获取产品的检具清单
export const getProdFixtureList = (params) => {
  return request({
    url: '/api/hg-public/prdprocedure/getCheckTool',
    method: 'get',
    params: {
      ...params,
    }
  })
}


//当前重要时间节点
//当前重要时间节点列表
export const getCurTimenodesList = (params) => {
  return request({
    url: '/api/hg-public/prdtimenodes/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增当前重要时间节点
export const addCurTimenodes = (row) => {
  return request({
    url: '/api/hg-public/prdtimenodes/save',
    method: 'post',
    data: row
  })
}

//删除当前重要时间节点
export const removeCurTimenodes = (ids) => {
  return request({
    url: '/api/hg-public/prdtimenodes/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新当前重要时间节点
export const updateCurTimenodes = (row) => {
  return request({
    url: '/api/hg-public/prdtimenodes/update',
    method: 'post',
    data: row
  })
}

//根据产品获取所在项目下拉选
export const getPRDProjects = (productDrawingNo) => {
  return request({
    url: '/api/hg-public/projectprdinfo/prjlistbyprddrawingno',
    method: 'get',
    params: {
      productDrawingNo,
    }
  })
}
//获取当前重要时间节点详情
export const getCurTimenodes = (id) => {
  return request({
    url: '/api/hg-public/prdtimenodes/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
//根据车间获取获取班组信息
export const getGroupList = (id) => {
  return request({
    url: '/api/hg-public/prdprocedure/getGroupList',
    method: 'get',
    params: {
      id,
    }
  })
}
